:- module(_, [pkg_desc/2], [persdb_mysql_op]).

:- use_module(library(aggregates),[findall/3]).
:- use_module(library(lists),[append/3]).

:- use_module(db(database_impl)).
:- use_module(library(terms)).

pkg_desc(Name,Description):-
	retrieve(K,asset(K,_,_,Name,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)),
	findall(D,retrieve(descriptions(K,D)),L),
	compose_description(L,Description).

compose_description(L,Desc):-
	atom_concat(L,Desc).   % Sql strings are Prolog atoms!!



